import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    token: '',
    userId: '',
    bool: false,
  },
  mutations: {
    tokenFn(state, token) {
      state.token = token
      console.log('更改了token', state.token)
    },
    userIdFn(state, id) {
      state.userId = id
      console.log('id', state.id)
    },
    isBoolFn(state) {
      state.bool = true
      console.log('我变了---', state.bool)
    }
  },
  actions: {
  },
  modules: {
  }
})
